<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title>呼叫云</title>
    <link rel="shortcut icon" href="../img/logox_circle.png">
    <link rel="stylesheet" href="../css/pintuer.css">
    <link rel="stylesheet" href="../css/admin.css">
	<script src="../js/jquery-1.11.0.min.js"></script>
	<script src="../js/fenye.js"></script>
	<script src="../js/config.js"></script> 
	<script>
		$(function(){
			$("#showName").val("tasks2");
			$("#phoneNumber").click(function(){
				$("#phoneNumberAlert").css("visibility","hidden");
			});
			$("#phonePassword").click(function(){
				$("#phonePasswordAlert").css("visibility","hidden");
			});
			$("#agentNumber").click(function(){
				$("#agentNumberAlert").css("visibility","hidden");
			});
			$("#agentPassword").click(function(){
				$("#agentPasswordAlert").css("visibility","hidden");
			});
		});
		//添加客服操作信息
		function updateUserTask(){
			var ok1=false;
            var ok2=false;
            var ok3=false;
            var ok4=false;
			
			var phoneNumber = $("#phoneNumber").val();
			if(phoneNumber!=""){
				ok1 = true;
			}else{
				$("#phoneNumberAlert").css("visibility","");
			}
			var phonePassword = $("#phonePassword").val();
			if(phonePassword!=""){
				ok2 = true;
			}else{
				$("#phonePasswordAlert").css("visibility","");
			}
			var agentNumber = $("#agentNumber").val();
			if(agentNumber!=""){
				ok3 = true;
			}else{
				$("#agentNumberAlert").css("visibility","");
			}
			var agentPassword = $("#agentPassword").val();
			if(agentPassword!=""){
				ok4 = true;
			}else{
				$("#agentPasswordAlert").css("visibility","");
			}
			var userTaskID = $("#userTaskID").val();
			if(ok1 && ok2 && ok3 && ok4){
               $.ajax({
				 url:serviceConfig.task.updateUserTask,
				 type: "get",
		         data:{
		         	userTaskID:userTaskID,
		         	phoneNumber:phoneNumber,
		         	phonePassword:phonePassword,
		         	agentNumber:agentNumber,
		         	agentPassword:agentPassword
		         },
		         dataType: "json",
		         success:function(data){
		        	 if(data.flag == 1){
		        	 	var message = $("#updateUserTaskButton").text();
		        	 	alert(message+"成功");
		        	 	var url=data.url;
						location.href=serviceConfig.task.getUserTaskList+url;
		        	 }
		         },
		         error:function(data){
		        	 console.log(data);
		         }
			});
            }
		}
		//返回
		function goback(){
			var url='${url}';
			location.href=serviceConfig.task.getUserTaskList+url;
		}
	</script>
</head>

<body>
<div class="lefter">
    <div class="logo"><a href="#" target="_blank"><img style="width:100%;" src="../img/logo3.png" alt="呼叫云后台管理系统" /></a></div>
</div>
<div class="righter nav-navicon" id="admin-nav">
    <div class="mainer">
        <div class="admin-navbar">
            <span class="float-right">
            	<span id="user_name"></span>
                <a class="button button-little bg-yellow" href="login">注销登录</a>
            </span>
            <#include "../common/head.ftl"> 
        </div>
        <div class="admin-bread">
            <ul class="bread">
                <li><a class="icon-user"> 任务管理</a></li>
                <li><a>客服任务</a></li>
				<li>客服操作信息</li>
            </ul>
        </div>
    </div>
</div>
<div class="admin">
	<div class="panel admin-panel">
			<div class="panel-head"><strong>客服操作信息</strong></div>
			<input type="hidden" id="userTaskID" name="userTaskID" value="${userTaskID}"/>
			<div style="float:left;width:50%;padding-left:30px;padding-top:20px;">
                <div style="float:left;padding-top:5px;"><strong>&nbsp;&nbsp;&nbsp;总机号码：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input" readonly="readonly" value="${userTaskMap.ims}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;"></div>
                </div>
            </div>
			<div style="float:left;width:50%;padding-left:30px;padding-top:20px;">
                <div style="float:left;padding-top:5px;"><strong>&nbsp;&nbsp;&nbsp;总机密码：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input" readonly="readonly" value="${userTaskMap.imsPasswd}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;"></div>
                </div>
            </div>
            <div style="float:left;width:100%;padding-left:30px;">
                <div style="float:left;padding-top:5px;"><strong>绑定手机号：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input" readonly="readonly" value="${userTaskMap.bindPhone}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;"></div>
                </div>
            </div>
            <div style="float:left;width:50%;padding-left:30px;">
                <div style="float:left;padding-top:5px;"><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;坐席号：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input"  id="phoneNumber" name="phoneNumber" value="${userTaskMap.phoneNumber}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="phoneNumberAlert" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;">坐席号不能为空！</div>
                </div>
            </div>
            <div style="float:left;width:50%;padding-left:30px;">
                <div style="float:left;padding-top:5px;"><strong>坐席号密码：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input" id="phonePassword" name="phonePassword" value="${userTaskMap.phonePassword}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="phonePasswordAlert" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;">坐席号密码不能为空！</div>
                </div>
            </div>
            <div style="float:left;width:50%;padding-left:30px;">
                <div style="float:left;padding-top:5px;"><strong>操作员账号：</strong></div>
                <div style="float:left;">
					<input type="number" style="width:200px;" class="input" id="agentNumber" name="agentNumber" value="${userTaskMap.agentNumber}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="agentNumberAlert" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;">操作员账号不能为空！</div>
                </div>
            </div>
            <div style="float:left;width:50%;padding-left:30px;">
                <div style="float:left;padding-top:5px;"><strong>操作员密码：</strong></div>
                <div style="float:left;">
					<input type="text" style="width:200px;" class="input" id="agentPassword" name="agentPassword" value="${userTaskMap.agentPassword}"/>
                </div>
				<div style="float:left;padding-left:20px;padding-top:3px;">
					<div id="agentPasswordAlert" class="alert alert-yellow" style="width:100%;height:30px;padding:5px;visibility:hidden;">操作员密码不能为空！</div>
                </div>
            </div>
            <div style="float:left;width:100%;padding-top:20px;padding-left:100px;">
            	<button class="button bg-main" style="width:80px;" id="updateUserTaskButton" onclick="updateUserTask()">确定</button>
            	<button class="button border-main" style="width:80px;margin-left:40px;" onclick="goback()">返回</button>
            </div>
        </div>
    </div>
</div>

</div>
</body>
</html>